from pathlib import PurePath
from typing import Optional, Dict, Literal

from fastapi import Response, Request


class BaseResource(object):
    FLG = 0
    PROP_MAPPING: Dict[str, Optional[str]]

    async def delete(self):
        pass

    async def move(self, dst: Optional[str], overwrite: Literal["F", "T"]):
        pass

    async def copy(
            self, dst: Optional[str], overwrite: Literal["F", "T"], depth: Literal["0", "infinity"]
    ):
        pass


class DavCollection(BaseResource):
    FLG = 1


class DavFileMember(BaseResource):
    FLG = 2
    size: int

    async def response_for_get(
            self, req_rng: str = None, chunk_size: int = 64 * 1024,
            head_only: bool = False
    ) -> Response:
        pass


class ResourceCreator(object):
    def __init__(self, dst: PurePath):
        self.dst = dst

    async def make_collection(self):
        pass

    async def put_file(self, request: Request):
        pass
